var params = {
    productid : 666,
    section   : 'products'
};
var url = 'http://example.org/page.php?',
    i,
    query = [];
for (i in params) {
    query.push(i + '=' + params[i]);
}
url += query.join('&');
console.log(url);

function Gadget(name, color) {
    this.name = name;
    this.color = color;
    this.getName = function () {
        return this.name();
    };
}
Gadget.prototype.price = 100;
Gadget.prototype.rating = 3;

var newtoy = new Gadget('webcam','black');
for (var prop in newtoy) {
    console.log(prop + ' = ' +newtoy[prop]);
}
console.log("newtoy.hasOwnProperty('name')");
console.log(newtoy.hasOwnProperty('name'));
console.log("newtoy.hasOwnProperty('price')");
console.log(newtoy.hasOwnProperty('price'));
for (var prop in newtoy) {
    if (newtoy.hasOwnProperty(prop)) {
        console.log(prop + ' = ' +newtoy[prop]);
    }
}